<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.cy.utils.dingtalk.DingTalkUtils" %>
<c:if test="${empty config}">
    <c:set var="config" value="<%=DingTalkUtils.getJsapiConfig(request)%>"/>
</c:if>
<script type="text/javascript" src="http://g.alicdn.com/dingding/dingtalk-pc-api/2.3.1/index.js"></script>
<script type="text/javascript">
    var _config = ${config};
    DingTalkPC.config({
        agentId : _config.agentid,
        corpId : _config.corpId,
        timeStamp : _config.timeStamp,
        nonceStr : _config.nonceStr,
        signature : _config.signature,
        jsApiList : ['biz.util.openLink']
    });

    DingTalkPC.error(function(err) {
        if (err.message.indexOf("52013") != -1){
            $.post("${gPath}/dingtalk/updateTicket", function () {
                window.location.reload();
            });
        } else {
            alert('dd error: ' + JSON.stringify(err));
        }
    });
</script>